<?php
	function fpub_setmeta($file,$tpl)
	{
		$sqlstr  = "SELECT meta.title, meta.keywords, meta.description";
		$sqlstr .= " FROM meta";
		$sqlstr .= " INNER JOIN contents_file ON contents_file.contents_id = meta.contents_table_id";
		$sqlstr .= " WHERE contents_file.f_name = '" . $file. "'";

		$res = fpub_runquery($con, $sqlstr);
		if (!$res) exit;
		
		list($meta_title,$meta_keywords,$meta_description) = mysql_fetch_row($res);
		
		$tpl->assign("t_meta_title", $meta_title);
		$tpl->assign("t_meta_keywords", $meta_keywords);
		$tpl->assign("t_meta_description", $meta_description);
		
		return $tpl;
	}

	//
	/*
	$tpl->assign("t_meta_title", $meta_title);
	$tpl->assign("t_meta_keywords", $meta_keywords);
	$tpl->assign("t_meta_description", $meta_description);
	*/
?>
